import _init_paths
import matplotlib
import numpy as np
import matplotlib.pyplot as plt

fname = 'normalsmall_10_16_nn_4_span_tree_'

x = np.loadtxt('../../data/result/%s/recall_l.txt' % fname)
for num_candidate in range(5, 13, 2):
    print(num_candidate)
    # num_candidate = 9
    col_x = x[num_candidate]
    num_bins = 5

    # the histogram of the data
    plt.hist(col_x, bins=num_bins, density=True)

    plt.xlabel('Smarts')
    plt.ylabel('Probability density')

    plt.savefig('%s%s.png' % (fname, str(num_candidate).zfill(2)))
    plt.close()
